<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>键盘事件</title>
</head>

<body>
  <div id="root">
    <!-- 键盘事件 -->
    <input type="text" @keyup.ctrl.enter="dopost">
    <hr>
    <!-- 了解就行 -->
    <input type="text" value="aaaaa" @keyup.113="dopost">
  </div>

  <script src="./lib/vue.js"></script>
  <script>
    // 自定义按键修饰符
    Vue.config.keyCodes.f2= 113

    new Vue({
      el: '#root',
      methods: {
        dopost(evt){
          console.log(evt.target.value)
        }
      }
    })
  </script>
</body>

</html>